package com.ajing.logextractor.filter;

import com.alibaba.fastjson2.JSONPath;

public class JsonFilter extends AbstractFilter {

    private final String jsonPath;

    public JsonFilter(String pattern, String match) {
        super(pattern, match);
        this.jsonPath = pattern;
    }

    @Override
    public boolean filter(String input) {
        return String.valueOf(JSONPath.extract(input, jsonPath)).equals(match);
    }

}
